package giab.weixin.web.httpimpl;

import java.util.ArrayList;

import giab.weixin.web.httpservice.HttpBaseService;
import giab.weixin.web.util.JsonUtil;
import giab.weixin.web.xml.bean.ServerMsg;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class FavoriteHttpImpl {
	@Autowired
	private HttpBaseService hbs;
	
	//favorite!save.action
	/**
	* @author 张怡菲
	* @createTime 	2013-5-7 下午4:44:36
	* @Title: favoriteSave
	* @Description: 收藏
	* @param weixinId
	* @param orderSubId
	* @return    String
	* @modifyTime	2013-5-7 下午4:44:36
	* 
	*/
	
	public ServerMsg favoriteSave(String weixinId,String orderSubId){
		ArrayList<NameValuePair> param = new ArrayList<NameValuePair>();
		param.add(new BasicNameValuePair("weixinId", weixinId));
		param.add(new BasicNameValuePair("orderSubId", orderSubId));
		String ru = hbs.postUrlResult("favorite!save.action", param);	
		return JsonUtil.getServerMsg(ru);
	}
	
	//favorite!list.action
	/**
	* @author 张怡菲
	* @createTime 	2013-5-7 下午4:46:57
	* @Title: favoriteList
	* @Description: 查询我的收藏
	* @param weixinId
	* @param pageNumber
	* @return    String
	* @modifyTime	2013-5-7 下午4:46:57
	* @modifyNote (在这里说明修改了什么)
	* 
	*/
	
	public ServerMsg favoriteList(String weixinId,String pageNumber){
		ArrayList<NameValuePair> param = new ArrayList<NameValuePair>();
		param.add(new BasicNameValuePair("weixinId", weixinId));
		param.add(new BasicNameValuePair("pageNumber", pageNumber));
		String ru = hbs.postUrlResult("favorite!list.action", param);	
		return JsonUtil.getServerMsg(ru);
	}
	
}
